﻿using System;
using UnityEngine;

namespace UniRx.Triggers
{
	// Token: 0x02000449 RID: 1097
	[DisallowMultipleComponent]
	public class ObservableTriggerTrigger : ObservableTriggerBase
	{
		// Token: 0x0600176A RID: 5994 RVA: 0x00063C31 File Offset: 0x00062031
		private void OnTriggerEnter(Collider other)
		{
			if (this.onTriggerEnter != null)
			{
				this.onTriggerEnter.OnNext(other);
			}
		}

		// Token: 0x0600176B RID: 5995 RVA: 0x00063C4C File Offset: 0x0006204C
		public IObservable<Collider> OnTriggerEnterAsObservable()
		{
			Subject<Collider> result;
			if ((result = this.onTriggerEnter) == null)
			{
				result = (this.onTriggerEnter = new Subject<Collider>());
			}
			return result;
		}

		// Token: 0x0600176C RID: 5996 RVA: 0x00063C74 File Offset: 0x00062074
		private void OnTriggerExit(Collider other)
		{
			if (this.onTriggerExit != null)
			{
				this.onTriggerExit.OnNext(other);
			}
		}

		// Token: 0x0600176D RID: 5997 RVA: 0x00063C90 File Offset: 0x00062090
		public IObservable<Collider> OnTriggerExitAsObservable()
		{
			Subject<Collider> result;
			if ((result = this.onTriggerExit) == null)
			{
				result = (this.onTriggerExit = new Subject<Collider>());
			}
			return result;
		}

		// Token: 0x0600176E RID: 5998 RVA: 0x00063CB8 File Offset: 0x000620B8
		private void OnTriggerStay(Collider other)
		{
			if (this.onTriggerStay != null)
			{
				this.onTriggerStay.OnNext(other);
			}
		}

		// Token: 0x0600176F RID: 5999 RVA: 0x00063CD4 File Offset: 0x000620D4
		public IObservable<Collider> OnTriggerStayAsObservable()
		{
			Subject<Collider> result;
			if ((result = this.onTriggerStay) == null)
			{
				result = (this.onTriggerStay = new Subject<Collider>());
			}
			return result;
		}

		// Token: 0x06001770 RID: 6000 RVA: 0x00063CFC File Offset: 0x000620FC
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onTriggerEnter != null)
			{
				this.onTriggerEnter.OnCompleted();
			}
			if (this.onTriggerExit != null)
			{
				this.onTriggerExit.OnCompleted();
			}
			if (this.onTriggerStay != null)
			{
				this.onTriggerStay.OnCompleted();
			}
		}

		// Token: 0x04000CDB RID: 3291
		private Subject<Collider> onTriggerEnter;

		// Token: 0x04000CDC RID: 3292
		private Subject<Collider> onTriggerExit;

		// Token: 0x04000CDD RID: 3293
		private Subject<Collider> onTriggerStay;
	}
}
